package com.zr.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.service.HRServicedtp;
import com.zr.serviceImpl.HRServiceImpldtp;

public class VacationControllerdtp extends HttpServlet {
	HRServicedtp hr=new HRServiceImpldtp();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("utf-8");
		int id=Integer.parseInt(req.getParameter("id"));
		String opinion=req.getParameter("opinion");
		String retime=req.getParameter("retime");
		String remake=req.getParameter("remake");
		boolean flag=hr.subVacation(id, opinion, retime, remake);
		PrintWriter pw=resp.getWriter();
		if(flag){
			pw.write("true");
		}else{
			pw.write("false");
		}
		pw.flush();
		pw.close();
	}
}
